package svc

import (
	"github.com/zeromicro/go-zero/core/stores/sqlx"
	"product/settings/model/regions"
	"product/settings/serve/internal/config"
)

type ServiceContext struct {
	Config       config.Config
	RegionsModel regions.RegionsModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	mysqlConnection := sqlx.NewMysql(c.DB.DataSource)
	return &ServiceContext{
		Config:       c,
		RegionsModel: regions.NewRegionsModel(mysqlConnection),
	}
}
